import { get, post, put, deletefn } from "@/utils/apiConfigs.js"

//商品参数列表数据
export const getCateListData = () => get("categories")

//获取动态参数数据或者静态参数数据
export const getHandleChange = (id, params) => get(`categories/${id}/attributes`, params)

//完成添加动态参数或者静态参数
export const getAddAttr = (id, params) => post(`categories/${id}/attributes`, params)

//打开修改时出现的对话框并把当前数据中的attr_name上传到input框中
export const getEnditDataList = (id1, id2) => get(`categories/${id1}/attributes/${id2}`)

////点击关闭修改时的对话框并且把编辑的内容进行修改实现实时监听
export const coseEnditDataList = (id1, id2, params) => put(`categories/${id1}/attributes/${id2}`, params)

//删除参数列表
export const getRemoveData = (id1, id2) => deletefn(`categories/${id1}/attributes/${id2}`)

// 删除,按下回车或者焦点出发时完成修改tag标签中参数的修改
export const getSaveAttrVals = (id1, id2, params) => put(`categories/${id1}/attributes/${id2}`, params)